<ui:composition template="../index/index.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">

	<ui:define name="content">
		<p:fieldset legend="Lista de Planos de Saúde">
			<h:form>
				<p:dataTable value="#{planoSaudeBean.planos}" var="planoSaude"
					paginator="true" rows="8">

					<p:column filterBy="#{planoSaude.nome}" filterMatchMode="contains"
						headerText="Nome">
						<h:outputText value="#{planoSaude.nome}"></h:outputText>
					</p:column>

					<p:column>
						<h:commandLink style="padding:3px" action="#{planoSaudeBean.view}" value="Vizualizar">
								<f:setPropertyActionListener target="#{planoSaudeBean.plano}" value="#{planoSaude}" />
							</h:commandLink>
							<h:commandLink style="padding:3px" action="#{planoSaudeBean.edit}" value="Editar">
								<f:setPropertyActionListener target="#{planoSaudeBean.plano}" value="#{planoSaude}" />
							</h:commandLink>
							<h:commandLink style="padding:3px" onclick="if(!confirm('Tem certeza que deseja remover este item?')) return false;" action="#{planoSaudeBean.delete}" value="Excluir">
								<f:setPropertyActionListener target="#{planoSaudeBean.plano}" value="#{planoSaude}" />
							</h:commandLink>
					</p:column>

				</p:dataTable>

				<h:commandButton action="#{planoSaudeBean.create}" value="Novo" />

			</h:form>
		</p:fieldset>
	</ui:define>
</ui:composition>